Rename gdk_surface_get_device_position_double
authorMatthias Clasen <mclasen@redhat.com>
Mon, 25 Mar 2019 14:12:01 +0000 (10:12 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 26 Mar 2019 22:12:54 +0000 (18:12 -0400)
Drop the _double suffix, now that the int version is gone.

13 files changed:
docs/reference/gdk/gdk4-sections.txt
gdk/broadway/gdkdevice-broadway.c
gdk/gdksurface.c
gdk/gdksurface.h
gdk/quartz/gdkdevice-core-quartz.c
gdk/wayland/gdkdevice-wayland.c
gdk/wayland/gdksurface-wayland.c
gdk/win32/gdkdevice-win32.c
gdk/x11/gdkdevice-core-x11.c
gtk/gtkmenu.c
gtk/gtktooltip.c
gtk/gtkwidget.c
gtk/inspector/inspect-button.c

index f25e3ef121d01a0f81e61820afae27935702b39c..76bfc40fec9d79c70f2e461c78c6f94366a2400f 100644 (file)
@@ -270,7 +270,7 @@ gdk_surface_get_root_origin
 gdk_surface_get_frame_extents
 gdk_surface_get_origin
 gdk_surface_get_root_coords
-gdk_surface_get_device_position_double
+gdk_surface_get_device_position
 GdkModifierType
 GdkModifierIntent
 gdk_surface_get_parent
index 2171ca90f64908d6380989dce915ed685b693331..a51ecc416dadd3023677a96f00d7fd6c1facaef2 100644 (file)
@@ -106,7 +106,7 @@ gdk_broadway_device_get_state (GdkDevice       *device,
 {
   gdouble x, y;
 
-  gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
+  gdk_surface_get_device_position (surface, device, &x, &y, mask);
 
   if (axes)
     {
index 11b92b2c19ec871a9a31b0dcfeca58d9df3d21ee..689999ba7598ebfd0b77d2cff884f29008629270 100644 (file)
@@ -2039,56 +2039,50 @@ if (geometry->max_aspect * height < width)
 }
 
 /**
-* gdk_surface_get_device_position_double:
-* @surface: a #GdkSurface.
-* @device: pointer #GdkDevice to query to.
-* @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
-* @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
-* @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
-*
-* Obtains the current device position in doubles and modifier state.
-* The position is given in coordinates relative to the upper left
-* corner of @surface.
-*
-* Returns: (nullable) (transfer none): The surface underneath @device
-* (as with gdk_device_get_surface_at_position()), or %NULL if the
-* surface is not known to GDK.
-**/
+ * gdk_surface_get_device_position:
+ * @surface: a #GdkSurface.
+ * @device: pointer #GdkDevice to query to.
+ * @x: (out) (allow-none): return location for the X coordinate of @device, or %NULL.
+ * @y: (out) (allow-none): return location for the Y coordinate of @device, or %NULL.
+ * @mask: (out) (allow-none): return location for the modifier mask, or %NULL.
+ *
+ * Obtains the current device position in doubles and modifier state.
+ * The position is given in coordinates relative to the upper left
+ * corner of @surface.
+ *
+ * Returns: (nullable) (transfer none): The surface underneath @device
+ * (as with gdk_device_get_surface_at_position()), or %NULL if the
+ * surface is not known to GDK.
+ **/
 GdkSurface *
-gdk_surface_get_device_position_double (GdkSurface       *surface,
-                               GdkDevice       *device,
-                               double          *x,
-                               double          *y,
-                               GdkModifierType *mask)
+gdk_surface_get_device_position (GdkSurface       *surface,
+                                 GdkDevice       *device,
+                                 double          *x,
+                                 double          *y,
+                                 GdkModifierType *mask)
 {
-gdouble tmp_x, tmp_y;
-GdkModifierType tmp_mask;
-gboolean normal_child;
+  gdouble tmp_x, tmp_y;
+  GdkModifierType tmp_mask;
 
-g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
-g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
-g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
-
-tmp_x = tmp_y = 0;
-tmp_mask = 0;
-normal_child = GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_device_state (surface,
-                                                                    device,
-                                                                    &tmp_x, &tmp_y,
-                                                                    &tmp_mask);
-/* We got the coords on the impl, convert to the surface */
-tmp_x -= surface->abs_x;
-tmp_y -= surface->abs_y;
+  g_return_val_if_fail (GDK_IS_SURFACE (surface), NULL);
+  g_return_val_if_fail (GDK_IS_DEVICE (device), NULL);
+  g_return_val_if_fail (gdk_device_get_source (device) != GDK_SOURCE_KEYBOARD, NULL);
 
-if (x)
-*x = tmp_x;
-if (y)
-*y = tmp_y;
-if (mask)
-*mask = tmp_mask;
+  tmp_x = tmp_y = 0;
+  tmp_mask = 0;
+  GDK_SURFACE_IMPL_GET_CLASS (surface->impl)->get_device_state (surface,
+                                                                device,
+                                                                &tmp_x, &tmp_y,
+                                                                &tmp_mask);
 
-if (normal_child)
-return _gdk_surface_find_child_at (surface, tmp_x, tmp_y);
-return NULL;
+  if (x)
+    *x = tmp_x;
+  if (y)
+    *y = tmp_y;
+  if (mask)
+    *mask = tmp_mask;
+
+  return NULL;
 }
 
 static gboolean
index 2fa1aacc1a4a602372587c16773aecc3a1130c61..122ca51ddd012d130bd8cd6fcab5533478ab7e3e 100644 (file)
@@ -640,11 +640,11 @@ GDK_AVAILABLE_IN_ALL
 gint          gdk_surface_get_scale_factor  (GdkSurface     *surface);
 
 GDK_AVAILABLE_IN_ALL
-GdkSurface *   gdk_surface_get_device_position_double (GdkSurface       *surface,
-                                                       GdkDevice       *device,
-                                                       gdouble         *x,
-                                                       gdouble         *y,
-                                                       GdkModifierType *mask);
+GdkSurface *   gdk_surface_get_device_position (GdkSurface      *surface,
+                                                GdkDevice       *device,
+                                                double          *x,
+                                                double          *y,
+                                                GdkModifierType *mask);
 GDK_AVAILABLE_IN_ALL
 GdkSurface *   gdk_surface_get_parent      (GdkSurface       *surface);
 GDK_AVAILABLE_IN_ALL
index 246dd5593314b02ff4d3551e6a8a65d15534b8e7..2d6233e0aeae2bafd2c4d8748d75dfe4ac69a46c 100644 (file)
@@ -125,7 +125,7 @@ gdk_quartz_device_core_get_state (GdkDevice       *device,
 {
   gdouble x_pos, y_pos;
 
-  gdk_surface_get_device_position_double (window, device, &x_pos, &y_pos, mask);
+  gdk_surface_get_device_position (window, device, &x_pos, &y_pos, mask);
 
   if (axes)
     {
index 317a285f968c786a85afebf8a4903f58db4cdb8e..26114033fe0cb623333d9c060bef79ed68d8c255 100644 (file)
@@ -321,7 +321,7 @@ gdk_wayland_device_get_state (GdkDevice       *device,
 {
   gdouble x, y;
 
-  gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
+  gdk_surface_get_device_position (surface, device, &x, &y, mask);
 
   if (axes)
     {
@@ -614,9 +614,9 @@ emulate_crossing (GdkSurface       *surface,
   gdk_event_set_device (event, device);
   gdk_event_set_source_device (event, device);
 
-  gdk_surface_get_device_position_double (surface, device,
-                                         &event->crossing.x, &event->crossing.y,
-                                         &event->crossing.state);
+  gdk_surface_get_device_position (surface, device,
+                                   &event->crossing.x, &event->crossing.y,
+                                   &event->crossing.state);
   event->crossing.x_root = event->crossing.x;
   event->crossing.y_root = event->crossing.y;
 
index 1be048e7a8d8330dfad69edb53e23d69564e7e6b..0466112803d8e92370cd932210e82a2bf6edc994 100644 (file)
@@ -2467,8 +2467,8 @@ gdk_wayland_surface_map (GdkSurface *surface)
           if (impl->position_method == POSITION_METHOD_NONE && grab_device)
             {
               double px, py;
-              gdk_surface_get_device_position_double (transient_for, grab_device,
-                                                      &px, &py, NULL);
+              gdk_surface_get_device_position (transient_for, grab_device,
+                                               &px, &py, NULL);
               surface->x = round (px);
               surface->y = round (py);
             }
index 3987e2c5df17736beeb8bee30afb5938c2d99149..8d42f5389e4927cf4926a66f0e29911df263dd94 100644 (file)
@@ -47,7 +47,7 @@ gdk_device_win32_get_state (GdkDevice       *device,
 {
   double x, y;
 
-  gdk_surface_get_device_position_double (window, device, &x, &y, mask);
+  gdk_surface_get_device_position (window, device, &x, &y, mask);
 
   if (axes)
     {
index 0b8bd8d4f7bfea731f00b253090aae2f37c6ae8e..d23c01a1bcd1eaf5b26c4a1ac9f7e45d1c72bc1e 100644 (file)
@@ -192,7 +192,7 @@ gdk_x11_device_core_get_state (GdkDevice       *device,
 {
   gdouble x, y;
 
-  gdk_surface_get_device_position_double (surface, device, &x, &y, mask);
+  gdk_surface_get_device_position (surface, device, &x, &y, mask);
 
   if (axes)
     {
index c75ff03eb82f9900d07cdf49271949ef2b118922..ae68e0c666775b79eeb2f9c436ec3ed27049a1bf 100644 (file)
@@ -1825,7 +1825,7 @@ gtk_menu_popup_at_pointer (GtkMenu        *menu,
           if (device)
             {
               double px, py;
-              gdk_surface_get_device_position_double (rect_surface, device, &px, &py, NULL);
+              gdk_surface_get_device_position (rect_surface, device, &px, &py, NULL);
               rect.x = round (px);
               rect.y = round (py);
             }
index c072d461060d43de79831c4720cafd6ab8a5f991..e5992529e229df082ca2a06f690935a23b3a343e 100644 (file)
@@ -634,9 +634,7 @@ gtk_tooltip_position (GtkTooltip *tooltip,
        * far away from the pointer position.
        */
       effective_toplevel = _gtk_widget_get_surface (toplevel);
-      gdk_surface_get_device_position_double (effective_toplevel,
-                                              device,
-                                              &px, &py, NULL);
+      gdk_surface_get_device_position (effective_toplevel, device, &px, &py, NULL);
       pointer_x = round (px);
       pointer_y = round (py);
 
@@ -697,7 +695,7 @@ gtk_tooltip_show_tooltip (GdkDisplay *display)
 
     device = gdk_seat_get_pointer (gdk_display_get_default_seat (display));
 
-    gdk_surface_get_device_position_double (surface, device, &px, &py, NULL);
+    gdk_surface_get_device_position (surface, device, &px, &py, NULL);
     x = round (px);
     y = round (py);
 
index 9d0dccc665caf71948b8ab5974a8247843c80d0a..7eaf9ade9bc4334090538e62f7b35582809b8278 100644 (file)
@@ -8645,11 +8645,11 @@ synth_crossing (GtkWidget       *widget,
   gdk_device_get_position_double (device,
                                   &event->crossing.x_root,
                                   &event->crossing.y_root);
-  gdk_surface_get_device_position_double (surface,
-                                         device,
-                                         &event->crossing.x,
-                                         &event->crossing.y,
-                                         NULL);
+  gdk_surface_get_device_position (surface,
+                                   device,
+                                   &event->crossing.x,
+                                   &event->crossing.y,
+                                   NULL);
   event->crossing.mode = mode;
   event->crossing.detail = detail;
   event->crossing.focus = FALSE;
index d34629d163020d6f29c04f2f33844923ca084dcd..76e52f4df1cd66319206e9b62cfead483bf53c30 100644 (file)
@@ -52,8 +52,8 @@ find_widget_at_pointer (GdkDevice *device)
     {
       double x, y;
 
-      gdk_surface_get_device_position_double (gtk_widget_get_surface (widget),
-                                             device, &x, &y, NULL);
+      gdk_surface_get_device_position (gtk_widget_get_surface (widget),
+                                       device, &x, &y, NULL);
 
       widget = gtk_widget_pick (widget, x, y);
     }